using System;
using System.Collections.Generic;
using System.Text;

namespace Platform.algorithm
{
    public enum ORDERTYPE {CHINESE_DESC, BASEUNIT_DESC }
    public enum KONWLEDGESET { GB18030, GB2312,GB18030_2005 }
    public class GlobalSetting
    {
        static public ORDERTYPE OrderType = ORDERTYPE.CHINESE_DESC;
        static public KONWLEDGESET KnowledgeSet = KONWLEDGESET.GB18030;
        static public bool SystemInputMethod = false;
        static public bool StructCodeLast = true;
        static public string GetKnowledgeFile()
        {
            if (KnowledgeSet == KONWLEDGESET.GB18030)
                return System.Windows.Forms.Application.StartupPath + @"\knowledge\kwg_18030.txt";
            else if (KnowledgeSet == KONWLEDGESET.GB2312)
                return System.Windows.Forms.Application.StartupPath + @"\knowledge\kwg_6763.txt";
            else if(KnowledgeSet == KONWLEDGESET.GB18030_2005)
                return System.Windows.Forms.Application.StartupPath + @"\knowledge\kwg_18030-2005.txt";
            else throw new Exception("Unkonw Knowledge File");
        }
        static public string GetUnitOrderFile()
        {
            if (KnowledgeSet == KONWLEDGESET.GB18030)
                return System.Windows.Forms.Application.StartupPath + @"\knowledge\18030.txt";
            else if (KnowledgeSet == KONWLEDGESET.GB2312)
                return System.Windows.Forms.Application.StartupPath + @"\knowledge\6763.txt";
            else if (KnowledgeSet == KONWLEDGESET.GB18030_2005)
                return System.Windows.Forms.Application.StartupPath + @"\knowledge\18030-2005.txt";
            else throw new Exception("Unkonw Knowledge File");
        }
        static public string GetBihuaFile()
        {
            return System.Windows.Forms.Application.StartupPath + @"\knowledge\base_bihua.txt";
        }
        static public string GetBasePath()
        {
            return GetBasePath(KnowledgeSet);
        }
        static public string GetBasePath(KONWLEDGESET ks)
        {
            if (ks == KONWLEDGESET.GB18030_2005)
                return "\\base\\base2\\";
            else return "\\base\\base1\\";
        }
    }
}
